﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace NUMIMAX.Controls
{
    /// <summary>
    /// Interaction logic for ustawienia_wybor.xaml
    /// </summary>
    public partial class ustawienia_wybor : Window
    {
        private int[] tablicaCheckBox = new int[19];
        public AddItemDelegate AddItemCallback;

        public ustawienia_wybor()
        {
            InitializeComponent();
        }

        private void checkBox1_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[0] = 1;
        }

        private void checkBox2_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[1] = 1;
        }

        private void checkBox3_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[2] = 1;
        }

        private void checkBox4_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[3] = 1;
        }

        private void checkBox5_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[4] = 1;
        }

        private void checkBox6_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[5] = 1;
        }

        private void checkBox7_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[6] = 1;
        }

        private void checkBox8_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[7] = 1;
        }

        private void checkBox9_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[8] = 1;
        }

        private void checkBox10_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[9] = 1;
        }

        private void checkBox11_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[10] = 1;
        }

        private void checkBox12_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[11] = 1;
        }

        private void checkBox13_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[12] = 1;
        }

        private void checkBox14_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[13] = 1;
        }

        private void checkBox15_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[14] = 1;
        }

        private void checkBox16_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[15] = 1;
        }

        private void checkBox17_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[16] = 1;
        }

        private void checkBox18_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[17] = 1;
        }

        private void checkBox19_Checked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[18] = 1;
        }

        private void checkBox1_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[0] = 0;
        }

        private void checkBox2_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[1] = 0;
        }

        private void checkBox3_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[2] = 0;
        }

        private void checkBox4_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[3] = 0;
        }

        private void checkBox5_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[4] = 0;
        }

        private void checkBox6_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[5] = 0;
        }

        private void checkBox7_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[6] = 0;
        }

        private void checkBox8_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[7] = 0;
        }

        private void checkBox9_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[8] = 0;
        }

        private void checkBox10_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[9] = 0;
        }

        private void checkBox11_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[10] = 0;
        }

        private void checkBox12_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[11] = 0;
        }

        private void checkBox13_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[12] = 0;
        }

        private void checkBox14_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[13] = 0;
        }

        private void checkBox15_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[14] = 0;
        }

        private void checkBox16_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[15] = 0;
        }

        private void checkBox17_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[16] = 0;
        }

        private void checkBox18_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[17] = 0;
        }

        private void checkBox19_Unchecked(object sender, RoutedEventArgs e)
        {
            tablicaCheckBox[18] = 0;
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            for (int i = 0; i < tablicaCheckBox.Length; i++)
            {
                AddItemCallback(i, tablicaCheckBox[i],false);
            }
            AddItemCallback(tablicaCheckBox.Length - 1, tablicaCheckBox[tablicaCheckBox.Length - 1], true);
        }
    }
}
